

Ext.define('pf.MainPanel', {
	extend: 'Ext.container.Container',
	requires: ['pf.util.MessageBus'],
	layout: 'card',
	deferredRender: false,
	activeItem: 'about',
	initComponent: function() {
		pf.util.MessageBus.on('switchcard', function(cardID) {
//		    var oldCard = this.layout.getActiveItem();
			
//		    this.layout.setActiveItem(cardID);
//		    var newCard = this.layout.getActiveItem();
////			var newCard = this.getComponent(cardID);
//			var slideDir = this.items.indexOf(oldCard) > this.items.indexOf(newCard) ? 'l' : 'r';
//			
//			oldCard.el.slideIn(slideDir);
//			newCard.el.slideIn(slideDir);
		    
		    this.layout.setActiveItem(cardID, 'left');
		}, this);
		this.callParent(arguments);
	},
	items: [
	    Ext.create('pf.contentCards.About'),
	    Ext.create('pf.contentCards.Resume'),
	    Ext.create('pf.contentCards.Projects'),
	    Ext.create('pf.contentCards.Coursework'),
	    Ext.create('pf.contentCards.Bookshelf'),
	    Ext.create('pf.contentCards.Contact')
	]
});